/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package cn.knet.sp.ncrm.modules.customer.appointment.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import cn.knet.sp.ncrm.common.persistence.DataEntity;

/**
 * 预约信息Entity
 * @author 冯亚鹏
 * @version 2015-09-08
 */
public class PotentialAppointmentInfo extends DataEntity<PotentialAppointmentInfo> {

	private static final long serialVersionUID = 1L;
	private String potentialCustomerId;		// 潜在客户id
	private String potentialCustomerName;		// 潜在客户名称
	private Date appointmentDate;		// 预约日期
	private String descn;		// 预约描述
	private String status;		// 预约状态
	private Date dateCreated;		// 创建时间
	private String createUserId;		// 创建人
	private String createUserName;		// 创建人名称
	private String visitRecordId;		// 回访记录ID
	private Date noticeDate;		// 通知时间
	private Long advanceMin;		// 提前分钟数
	private Date lastUpdated;		// 更新时间
	private Date startAppointmentDate;	// 预约日期开始时间
	private Date endAppointmentDate;		// 预约日期结束时间
	private String userId;		// 当前用户ID,查询辅助字段

	public PotentialAppointmentInfo() {
		super();
	}

	public PotentialAppointmentInfo(String id){
		super(id);
	}

	@Length(min=0, max=32, message="潜在客户id长度必须介于 0 和 32 之间")
	public String getPotentialCustomerId() {
		return potentialCustomerId;
	}

	public void setPotentialCustomerId(String potentialCustomerId) {
		this.potentialCustomerId = potentialCustomerId;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getAppointmentDate() {
		return appointmentDate;
	}

	public void setAppointmentDate(Date appointmentDate) {
		this.appointmentDate = appointmentDate;
	}

	@Length(min=0, max=512, message="预约描述长度必须介于 0 和 512 之间")
	public String getDescn() {
		return descn;
	}

	public void setDescn(String descn) {
		this.descn = descn;
	}

	@Length(min=0, max=32, message="预约状态长度必须介于 0 和 32 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	@Length(min=0, max=32, message="创建人长度必须介于 0 和 32 之间")
	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	@Length(min=0, max=32, message="回访记录ID长度必须介于 0 和 32 之间")
	public String getVisitRecordId() {
		return visitRecordId;
	}

	public void setVisitRecordId(String visitRecordId) {
		this.visitRecordId = visitRecordId;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getNoticeDate() {
		return noticeDate;
	}

	public void setNoticeDate(Date noticeDate) {
		this.noticeDate = noticeDate;
	}

	public Long getAdvanceMin() {
		return advanceMin;
	}

	public void setAdvanceMin(Long advanceMin) {
		this.advanceMin = advanceMin;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getLastUpdated() {
		return lastUpdated;
	}

	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}

	public String getPotentialCustomerName() {
		return potentialCustomerName;
	}

	public void setPotentialCustomerName(String potentialCustomerName) {
		this.potentialCustomerName = potentialCustomerName;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public Date getStartAppointmentDate() {
		return startAppointmentDate;
	}

	public void setStartAppointmentDate(Date startAppointmentDate) {
		this.startAppointmentDate = startAppointmentDate;
	}

	public Date getEndAppointmentDate() {
		return endAppointmentDate;
	}

	public void setEndAppointmentDate(Date endAppointmentDate) {
		this.endAppointmentDate = endAppointmentDate;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Override
	public void preInsert() {
		this.dateCreated = new Date();
		this.createDate = new Date();
		this.lastUpdated = new Date();
		super.preInsert();
	}

	@Override
	public void preUpdate() {
		this.lastUpdated = new Date();
		super.preUpdate();
	}
}